package org.example.tinyurl.entity;

/**
 * @author: zk
 * @date: 2023/6/22 18:52
 */
public enum ResultStatus {

    /**
     * 请求成功
     */
    OK(2000, "成功"),

    /**
     * 重定向
     */
    EXPIRE(3001, "已过期"),


    /**
     * 客户端错误
     */
    ERROR(4000, "失败"),
    PARSE_ERROR(4001, "解析失败"),
    DUPLICATE_ERROR(4002, "哈希冲突次数过多"),
    NOT_EXIST_ERROR(4004, "不存在"),


    /**
     * 服务端错误
     */
    REMOTE_ERROR(50001, "远程调用失败");

    private final int code;
    private final String message;

    ResultStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
